package own.dubbo.consumer;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class ConsumerUtils {

	private static String path = "classpath:own/dubbo/consumer/spring-consumer.xml";
	private static ApplicationContext context;
	
	 static {
	        context = new ClassPathXmlApplicationContext(path);
	 }
	
	public static Object getBean(String beanName){
        Object object = null;
        try {
            object = context.getBean(beanName);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return object;
    }
}
